package com.lagou.bean;

import com.lagou.service.HelloService;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;



@Component
public class ComsumerComponet {

    @Reference //Reference 注入得是dubbo分布式中的远程服务对象 Resource和Autowired是注入的是本地spring容器的对象
    private HelloService helloService;

    public String SaveHello(String name){
        return  helloService.sayHello(name);
    }

    /**
     * 方法处理
     * @param type
     * @return
     */
    public String method(String type){
        if (type.equals("A")){
            return helloService.methodA();
        } else if (type.equals("B")) {
            return helloService.methodB();
        } else if (type.equals("C")){
            return helloService.methodC();
        }
        return "调用错误";
    }

}
